// Copyright (c) 2024, the Dart project authors.
// All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:meta/meta.dart' show internal;

import '../arkobject.dart' hide ArkObject;
import '../arkreference.dart';
import '../types.dart';

// Simple ArkByte implementation
class ArkByte {
  final int value;
  
  ArkByte(this.value);
  
  ArkByte.fromReference(ArkReference reference) : value = 0; // TODO: implement
  
  static const type = ArkByteType();
  static const nullableType = ArkByteNullableType();

  static final _class = ArkClass.forName(r'ark/lang/Byte');
  static final _ctorId = _class.constructorId(r'(B)V');
  
  ArkByte.byteCtor(int byte) : value = byte;

  static final _byteValueId =
      _class.instanceMethodId(r'byteValue', r'()B');

  int byteValue({bool releaseOriginal = false}) {
    // TODO: implement actual method call
    return value;
  }
  
  @override
  String toString() => 'ArkByte($value)';
}

// Simple type definitions
class ArkByteType {
  const ArkByteType();
}

class ArkByteNullableType {
  const ArkByteNullableType();
}